/*
    资源文件
 */

import {
  StyleSheet,
  Dimensions,
  Platform,
  ViewStyle,
  TextStyle,
  ImageStyle,
} from "react-native";
let { width, height } = Dimensions.get("window");
const hairlineWidth = StyleSheet.hairlineWidth;

const color = {
  titleBg: "#bcb1ec",
  white: "#ffffff",
  focusedTab: "#458B74",
  unfocusedTab: "#34F2E7",
};

/* eslint no-bitwise: 0 */
const hashCode = (str: any) => {
  let hash = 15;
  for (let ii = str.length - 1; ii >= 0; ii--) {
    hash = (hash << 5) - hash + str.charCodeAt(ii);
  }
  return hash;
};
const navigationView: ViewStyle = {
  flexDirection: "row",
  height: 40,
  width: "100%",
  alignItems: "center",
};

const navigationButtonLeft: TextStyle = {
  marginTop: 0,
  paddingLeft: 10,
  paddingRight: 10,
  color: color.white,
  fontSize: 15,
};

const navigationButton: ImageStyle = {
  width: 24,
  height: 20,
};
const navigationButtonRight: TextStyle = {
  marginTop: 0,
  marginRight: 10,
  color: color.white,
  fontSize: 15,
};
const navigationTitleFont: TextStyle = {
  color: color.white,
  textAlign: "center",
  fontSize: 18,
  position: "absolute",
  width: "100%",
  fontFamily: "PingFangSC-Medium",
};

const box: ViewStyle = {
  paddingTop: 4,
  flexDirection: "column",
  justifyContent: "flex-start",
  alignItems: "center",
};
const text20: TextStyle = {
  color: "#aaf10c",
  fontSize: 20,
  textAlign: "center",
};
const text16: TextStyle = {
  color: "#d38322",
  fontSize: 16,
  textAlign: "center",
};
const text14: TextStyle = {
  color: "#2b2b2b",
  fontSize: 14,
  textAlign: "center",
};
const text12: TextStyle = {
  color: "#601685",
  fontSize: 12,
  textAlign: "center",
};
const text10: TextStyle = {
  color: "#6A7280",
  fontSize: 10,
  textAlign: "center",
};
const row: ViewStyle = {
  flexDirection: "row",
  justifyContent: "center",
  padding: 10,
  backgroundColor: "#F6F6F6",
};
const thumb: ViewStyle = {
  width: 64,
  height: 64,
};
const text: TextStyle = {
  flex: 1,
};
const map: ViewStyle = {
  width: width,
  height: height,
};
const line: ViewStyle = {
  width: "100%",
  height: 0.5,
  backgroundColor: "#F5F6FA",
};

const schadule_bord: ViewStyle = {
  flex: 1,
  justifyContent: "center",
  backgroundColor: "#ffffff",
  borderWidth: 1,
  borderRadius: 5,
  padding: 10,
  borderColor: "#F8F8F9",
};

const schadule_address: TextStyle = {
  color: "#6A7280",
  fontSize: 14,
  textAlign: "left",
};

const schadule_visitStatus: TextStyle = {
  backgroundColor: "#ffffff",
  borderWidth: 2,
  borderRadius: 5,
  borderColor: "#eeeddd",
  paddingLeft: 5,
  paddingRight: 5,
  paddingTop: 4,
  fontSize: 10,
  marginLeft:12,
  textAlign: "center",
  fontFamily: "PingFangSC-Regular",
};

const schadule_name: TextStyle = {
  paddingLeft: 6,
  fontSize: 18,
  flex: 1,
  color: "#222222",
  textAlign: "left",
  fontFamily: "PingFangSC-Medium",
};

const schadule_pop: ViewStyle = {
  flexDirection: "column",
  position: "absolute",
  right: 25,
  bottom: 0,
  backgroundColor: "#ffffff",
  borderColor: "#eeeeee",
  borderWidth: 1,
  borderRadius: 5,
};

const schadule_bottom: ViewStyle = {
  paddingTop: 4,
  paddingBottom: 4,
  flexDirection: "row",
  alignItems:"center",
};

const schadule_bottomRight: ViewStyle = {
  position: "absolute",
  right: 0,
  flexDirection: "row",
};



const styles = {
  navigationView,
  navigationButtonLeft,
  navigationButton,
  navigationButtonRight,
  navigationTitleFont,
  box,
  text20,
  text16,
  text14,
  text12,
  text10,
  row,
  thumb,
  text,
  map,
  line,
  schadule_bord,
  schadule_visitStatus,
  schadule_address,
  schadule_name,
  schadule_pop,
  schadule_bottom,
  schadule_bottomRight,
};

const isIphoneX = () => {
  const dimen = Dimensions.get("window");
  return (
    (Platform.OS === "ios" &&
      !Platform.isPad &&
      !Platform.isTVOS &&
      (dimen.height === 812 || dimen.width === 812)) ||
    dimen.height === 896 ||
    dimen.width === 896 ||
    dimen.height === 1125 ||
    dimen.width === 828 ||
    dimen.height === 1792 / 3 ||
    dimen.width === 1792 / 3
  );
};

let Resource = {
  color,
  styles,
  hairlineWidth,
  hashCode,
  isIphoneX,

  LangueKey: 'zh', //本地语言
};

export default Resource;
